page.tsx 608 B

123456789101112131415161718192021
  1. import { fetchUserFeed } from '@/lib/api/account/profile';
  2. import FeedList from '@/app/(main)/feed/_component/FeedList';
  3. type Props = {
  4. params: Promise<{ sid: string }>;
  5. };
  6. export default async function UserProfileFeedPage({ params }: Props) {
  7. const { sid } = await params;
  8. const res = await fetchUserFeed(sid, 1, 20);
  9. const data = res.data ?? { total: 0, list: [], authorSID: sid, authorName: '' };
  10. return (
  11. <FeedList
  12. initialCards={data.list}
  13. initialTotal={data.total}
  14. endpoint={`/api/member/${encodeURIComponent(sid)}/feed`}
  15. emptyMessage="작성한 피드가 없습니다."
  16. />
  17. );
  18. }